<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="/WEB-INF/templates/forms.xhtml"
                >
        
                <ui:define name="title"><h:outputText value="Packing List #{invoiceBean.invoice.number}/#{invoiceBean.invoice.year} #{invoiceBean.getPackingListPaginationInfo()}"/></ui:define>
        
        <ui:define name="content">
        <h:form id="form" styleClass="form" style="font-size: 14px !important; font-family: Tahoma !important; width: 20cm; margin: auto;">
        	
        	<p:graphicImage value="/images/gjerde-logo-small.jpg" style="width: 100px; margin: 0px; float:left; margin-bottom: 10px; margin-top:-20px; position: absolute;" />
        	
        	<div style="color: blue; font-size: 30px !important; font-family:'Helvetica Neue',sans-serif !important; margin: 10px auto; width: 300px; font-weight: bold;">Sia Saldus Welding</div>
        	
        	<div style="float:left; width: 400px; clear: both; text-align: right;">
        		<h:outputText style="font-weight: bold; text-align: right;" value="Seller:" />
        		<div style="width: 250px; float:right; text-align: left; padding-left: 5px;">
		        	<h:outputText escape="false" value="#{invoiceBean.invoice.sellerInfo.name}" style="font-size: 14px !important;" /> <br />
		        	<h:outputText escape="false" value="#{invoiceBean.replaceNewlines(invoiceBean.invoice.sellerInfo.address)}" /> <br /><br />
        		</div>
        	</div>
        	<div style="width: 300px; float:right;">
        		<h:outputText escape="false" value="#{invoiceBean.replaceNewlines(invoiceBean.invoice.sellerInfo.properties)}" />
        	</div> <br /><br /><br />
        	
        	<div style="float:left; width:400px; clear: both; text-align: right;">
        		<h:outputText style="font-weight: bold;" value="Buyer:" />
        		<div style="width: 250px; float:right; text-align: left; padding-left: 5px;">
		        	<h:outputText escape="false" value="#{invoiceBean.invoice.buyerInfo.name}" style="font-size: 14px !important;" /> <br />
		        	<h:outputText escape="false" value="#{invoiceBean.replaceNewlines(invoiceBean.invoice.buyerInfo.address)}" /> <br />
		    	</div>
        	</div>
        	<div style="width: 300px; float:right;">
        		<h:outputText escape="false" value="#{invoiceBean.replaceNewlines(invoiceBean.invoice.buyerInfo.properties)}" />
        	</div>
        	
        	<div style="float:left; width:400px; clear: both; text-align: right;">
	        	<h:outputText value="Delivery address:" style="font-weight: bold;" />
	        	<div style="width: 250px; float:right; text-align: left; padding-left: 5px;">
	        		<h:outputText escape="false" value="#{invoiceBean.replaceNewlines(invoiceBean.invoice.deliveryInfo.name)}" /> <br />
	        		<h:outputText escape="false" value="#{invoiceBean.replaceNewlines(invoiceBean.invoice.deliveryInfo.address)}" /> <br /><br />
        		</div>
        	</div>
        	
        	<div style="clear:both; float:left;">
        		<h:outputText value="Purchase No.: #{invoiceBean.invoice.purchaseNumber}"/> <br />
        		<h:outputText value="Marking: #{invoiceBean.invoice.marking}"/> <br />
        		<h:outputText value="Your ref.: #{invoiceBean.invoice.ref}"/>
        	</div>
        	<div style="float:left; margin-left: 100px;">
        		<h:outputText value="Contact Person: #{invoiceBean.invoice.contactPerson}"/> <br />
        		<h:outputText value="Tel: #{invoiceBean.invoice.contactTel}"/>
        	</div>
        	
        	<h1 style="font-family: Tahoma !important; text-align:center; font-weight: bold; padding-top: 10px; padding-bottom: 10px; clear:both;"><h:outputText value="PACKING LIST &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Nr. SW #{invoiceBean.invoice.number}/#{invoiceBean.invoice.year} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #{invoiceBean.getPackingListPaginationInfo()}" /></h1>
        	
        	<p:dataTable var="p" value="#{invoiceBean.invoice.productData}" styleClass="formTable borderless invoiceTable">
				<p:column headerText="Product Nr.">
					#{p.pno}
				</p:column>
				<p:column headerText="Product" width="350" styleClass="textLeftTable wrap">
					#{p.desc}
				</p:column>
				<p:column headerText="Pcs">
					#{p.pcs}
				</p:column>
				<p:column headerText="Weight kg">
					#{p.weight}
				</p:column>
				<p:column headerText="Total Weight kg">
					#{invoiceBean.setScale(invoiceBean.calculateTotalWeight(p), 2)}
				</p:column>
			</p:dataTable>
			
			
			
			
        	
        	<div style="float: right; width:300px; margin-top: 30px;">
        		<div style="text-align:right; width:150px; float:left;">
					<h:outputText value=" " /> <br />
					<h:outputText value=" " /> <br />
					<h:outputText value=" " style="font-weight: bold;" /> <br /><br />
				</div>
				<div style="width:50px;"></div>
				<div style="width:100px; float:right; text-align: center;">					
					<h:outputText value=" " /> <br />
					<h:outputText value=" " style="font-weight: normal;" /> <br />
					<h:outputText value=" " style="font-weight: bold;" /> <br /><br />
				</div>					
			</div>
			
			
			
			
			
			
			<div style="margin:auto; width:400px; clear:both;">
        		<div style="text-align:right; width:300px; float:left;">
					<h:outputText value="Netto weight" /> <br />
					<h:outputText value="Packingmaterial plastic" rendered="#{invoiceBean.invoice.packingPlastic}" /> <br />
					<h:outputText value="Packingmaterial #{invoiceBean.invoice.pcs} #{invoiceBean.invoice.otherType}" rendered="#{invoiceBean.invoice.packingOther}" /> <br />
					<h:outputText value="Brutto weight" />
				</div>
				<div style="width:100px; float:right; text-align: right;">		
					<h:outputText value="#{invoiceBean.setScale(invoiceBean.invoice.nettoWeight,2)} kg" /> <br />			
					<h:outputText value="#{invoiceBean.setScale(invoiceBean.invoice.plasticWeight,2)} kg" rendered="#{invoiceBean.invoice.packingPlastic}" /> <br />			
					<h:outputText value="#{invoiceBean.setScale(invoiceBean.invoice.otherWeight,2)} kg" rendered="#{invoiceBean.invoice.packingOther}" style="float:right;" />
					<h:outputText value="#{invoiceBean.invoice.size}" rendered="#{invoiceBean.invoice.packingOther}" style="float:right; left: 100px; position:relative; width: 0px;" /> <br />			
					<h:outputText value="#{invoiceBean.setScale(invoiceBean.invoice.bruttoWeight,2)} kg" style="clear:both; float:right;" />			
				</div>					
			</div><br style="clear:both;" />
			
			
			
			<div style="margin:auto; width:700px;">
				<div style="float:left; width: 400px;">
					<h:outputText value=" " /><br />
					<h:outputText value="This product is wholly produced" /><br />
					<h:outputText value="in the country of Latvia" /><br /><br />
					<h:outputText value="Saldus #{invoiceBean.invoice.creationDate}" /><br />
					<h:outputText value="Terms of delivery: #{invoiceBean.invoice.termsDelivery}" /><br />
					<h:outputText value="Delivery date: #{invoiceBean.invoice.deliveryDate}" /><br />
					<h:outputText value=" " /><br />
					<h:outputText value=" " /><br />
					<h:outputText value="Sia Saldus Welding" /><br />
					<h:outputText value="Santa Fridrihsone" /><br />
				</div>
				<div style="float:right; width:300px;">
					<div>
						<h:outputText value="HS CODE: #{invoiceBean.invoice.hsCode}" /> <br /><br />
					</div>
					<div>
						<h:outputText escape="false" value="#{invoiceBean.replaceNewlines(invoiceBean.invoice.specification)}" />
					</div>
				</div>
			</div>
			
			<div style="clear: both;">
				<h:outputText escape="false" value="#{invoiceBean.replaceNewlines(invoiceBean.invoice.pvn)}" />
			</div>
        	
        </h:form>
        </ui:define>
        
</ui:composition>